Apparatus for carrying ophthalmic lenses

ABSTRACT

An apparatus for carrying an ophthalmic lens, particularly while the lens is being inspected, including a base member and a well connected to the base member. The well is substantially transparent, and includes a frusto-conical sidewall having a constant slope, and a hemi-spherically shaped bottom portion connected to an extending downward from the sidewall. The bottom portion of the well has curvature that is about 10% larger than the radius of curvature of the ophthalmic lens.

This is a continuation of application Ser. No. 995,622 filed on Dec. 21,1992 now abandoned.

BACKGROUND OF THE INVENTION

This application relates to copending application Ser. No. 995,281 filedherewith for "A Method and System for Automatically InspectingOphthalmic Lenses," to copending application Ser. No. 994,565 filedherewith for "Illumination and Imaging Subsystems for a Lens InspectionSystem," to copending application Ser. No. 995,654 filed herewith for "AMethod of Inspecting Ophthalmic Lenses," and to copending applicationSerial No. 994,654 filed herewith for "A Lens Inspection System."

This invention generally relates to carriers for ophthalmic lenses, andmore particularly, to lens carriers that are especially well suited forholding contact lenses while the lenses are being inspected.

Contact lenses are, typically, made with a high degree of precision andaccuracy. Nevertheless, on rare occasions, a particular lens may containan irregularity; and for this reason, contact lenses are inspectedbefore sale to the consumer to be certain that the lenses are acceptablefor consumer use.

In one type of prior art lens inspection system, the lenses are placedin small cups or wells and moved through a lens inspection position,where an illuminating beam is transmitted through each lens. Thatilluminating beam is then focused on a screen to produce thereon animage of the lens, and an operator looks at that image to determine ifthe lens contains any irregularities. If any irregularity or flaw isfound that makes the lens unsuitable for consumer use, then the lens iseither removed from the inspection system or otherwise identified sothat it is not subsequently sold to a consumer.

The lens carrier is an important element of this inspection system. Inparticular, it is important to minimize the affect that the lens carrierhas on the illuminating beam transmitted through the ophthalmic lenses,because disturbances in that illuminating beam that are caused by thelens carrier may be interpreted by the operator as an irregularity inthe lens being inspected.

In addition, it is highly advantageous that the lens carrier be readilydisposable. This is so because if a lens carrier is reused, smallscratches may be made on the carrier, and these scratches may deflect orrefract part of the illuminating beam used to inspect the ophthalmiclenses. An operator may observe the image produced by this deflected orrefracted light and interpret it as an irregularity or flaw in the lensbeing inspected.

Despite the above-mentioned considerations, the prior art lensinspection systems of the above-discussed general type are veryeffective and reliable; however, these systems are also comparativelyslow and expensive. This is so because a human operator must focus onthe lens image produced on the screen and check that whole image for anyirregularity. It is thus believed that the prior art systems can beimproved upon; and in particular, it is believed that the cost of thelens inspection can be reduced and the speed of the inspection can beincreased by providing an automated system to perform these inspections.

In any automated system, it is important that the lens be positionedprecisely relative to the illuminating beam that is transmitted throughthe lens. This, in turn, requires that the lens carrier--in addition tomeeting the criteria discussed above--hold the lens in a well definedposition as the carrier is moved through the system, and also beprecisely movable over a given pattern or path.

SUMMARY OF THE INVENTION

An object of this invention is to improve carriers for ophthalmiclenses.

Another object of this invention is to provide a disposable lens carrierthat is particularly well suited for receiving, holding, and movingcontact lenses in an automated lens inspection system.

A further object of this invention is to provide a lens carrier having amultitude of lens cups, each of which guides a contact lens into andthen holds the lens in a specific, well defined position inside the cup.

These and other objectives are obtained with an apparatus for carryingophthalmic lenses, comprising a base member and a multitude of wellsconnected to the base member. Each of the wells is substantiallytransparent and is adapted to hold a respective one of the lenses. Also,each of the wells includes a frusto-conical sidewall having a constantslope, and a hemi-spherically shaped bottom portion connected to andextending downward from the sidewall. This bottom portion of each wellhas a constant radius of curvature about 10% larger than the radius,ofcurvature of the lens placed in the well.

Preferably, the sidewall, of each well extends at an angle of about 20°to the axis of that well, and the thickness of the sidewall of each wellis less than about 0.010 inches. In addition, preferably, the bottomportion of each well has a diameter larger than the diameter of the lensplaced in the well, and each well also has a depth greater than thatlens diameter.

Further benefits and advantages of the invention will become apparentfrom a consideration of the following detailed description given withreference to the accompanying drawings, which specify and show preferredembodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates a system for automatically inspectingophthalmic lenses.

FIG. 2 is a plan view of one type of ophthalmic lens that may beinspected by the system of FIG. 1.

FIG. 3 is a side view of the lens shown in FIG. 2.

FIG. 3A is an enlarged view of a peripheral portion of the lens shown inFIGS. 2 and 3.

FIG. 4 is a more detailed view of the transport subsystem used in thelens inspection system of FIG. 1.

FIG. 5 is a plan view of a lens carrier used in the system of FIG. 1.

FIG. 6 is a side view of the lens carrier shown in FIG. 1.

FIG. 7 is a schematic diagram generally illustrating the principles ofan illumination technique referred to as dark field illumination.

FIG. 8 is a more detailed diagram of the illumination and imagingsubsystems of the lens inspection system shown in FIG. 1.

FIG. 9 shows a portion of a pixel array of the imaging subsystem.

FIG. 10 shows an image that is formed on the pixel array when anophthalmic lens of the type shown in FIGS. 2 and 3, is being inspectedin the lens inspection system of FIG. 1.

FIGS. 11A, 11B, and 11C show three alternate optical configurations thatmay be used in the illumination and imaging subsystem.

FIG. 12A illustrates the operation of a control subsystem of the lensinspection system.

FIG. 12B is a time diagram illustrating the sequence of various eventsin the operation of the transport, illumination, and imaging subsystems.

FIG. 13 schematically illustrates the data processing subsystem of thelens inspection system.

FIG. 14 generally illustrates the major components of a preferred dataprocessing procedure employed with the lens inspection system.

FIG. 15 shows an image of an ophthalmic lens formed on the pixel arrayof the lens inspection system.

FIGS. 16A and 16B are flow charts illustrating a lens inspectionprocedure referred to as a decentration test.

FIG. 17A is similar to FIG. 15 and shows the image of an ophthalmic lensformed on the pixel array.

FIG. 17B is an enlarged view of a portion of the annulus shown in FIG.17A.

FIG. 17C is a graph showing the intensities at which certain pixels, ona line segment across FIG. 17B, are illuminated.

FIGS. 17D-17I graphically illustrate the results of various processesperformed on the illumination intensity values of those-certain pixelsto derive processed values for the pixels that help identify the edgesof the annulus shown in FIG. 17A.

FIG. 17J shows the pixels of the pixel array illuminated at theirprocessed illumination values.

FIG. 18 is a flow chart showing a preferred procedure for processing theinitial illumination intensity values determined for the pixels of thepixel array.

FIGS. 19A-19C show the effect of a masking procedure on data values forthe pixels of the pixel array.

FIG. 20 is a flow chart illustrating a preferred masking procedure.

FIGS. 21A and 21B illustrate a further data processing procedurereferred to as the rubber band algorithm.

FIG. 22 shows a subroutine used to identify a first pixel on the edge ofthe line image.

FIG. 23 is a flow chart showing in greater detail a first main sectionof the rubber band algorithm.

FIG. 24 is a flow chart showing a subroutine that is invoked when a gapis found in the outside edge of the image of the lens.

FIGS. 25A-25E show a portion of the outside edge of the image of thelens and identify various pixels of interest on that edge.

FIG. 26 is a flow chart of a subroutine that is invoked when an extrapiece is found on the outside edge of the lens image.

FIG. 27 shows a routine that is invoked after the procedure outlined inFIG. 23 is complete.

FIG. 28 is a flow chart showing in greater detail a second main sectionof the rubber band algorithm.

FIG. 29 shows the outer edge of a portion of the lens image, and showsseveral vectors that are used in the second section of the rubber bandalgorithm.

FIG. 30 is a flow chart outlining in greater detail a third main sectionof the rubber band algorithm.

FIGS. 31 and 32 pictorially illustrate the effect of two steps of theprocedure shown in FIG. 30.

FIG. 33 shows a portion of the outer edge of the annulus, with certainlines added on to that edge.

FIGS. 34A-34E generally illustrate the results of various operationsreferred to as MAX, PMAX, MIN, and PMIN.

FIG. 35 shows a preferred procedure that is applied to pixel data valuesto emphasize or highlight possible defects in the lens edge.

FIG. 36 illustrates the results of the procedure shown in FIG. 35.

FIG. 37 is a flow chart showing a second masking procedure employed inthe processing of the pixel data.

FIGS. 38A-38C pictorially illustrate this second masking procedure andthe results thereof.

FIG. 39 is a flow chart of a further procedure applied to the pixel datato emphasize further any defects in the lens being inspected.

FIGS. 40A-40D pictorially illustrate the operation and results of theprocedure outlined in FIG. 39.

FIGS. 41A and 41B show a flow chart of a procedure used to identify anyflaws or defects in the lens being inspected.

FIG. 42 shows various types of possible defects in the lens.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 is a block diagram illustrating lens inspection system 10; andgenerally system 10 comprises transport subsystem 12, illuminationsystem 14, imaging subsystem 16, and image processing subsystem 20. Withthe preferred embodiment of system 10, transport subsystem 12 includeslens carrier 22 and support assembly 24 (shown in FIG. 4); andillumination subsystem 14 includes housing 26, light source 30, andmirrors 32 and 34. Also, with this preferred system 10, imagingsubsystem 16 includes camera 36, stop 40, and lens assembly 42. Morespecifically, with reference to FIG. 8, the camera includes housing 44,pixel array 46, and shutter 50; and the lens assembly includes housing52, a pair of lenses 54 and 56, and a plurality of baffles 60. As shownin FIG. 1, image processing subsystem 20 includes preprocessor 62, mainprocessor 64, and input means such as keyboard 66; and preferablysubsystem 20 further includes memory unit 70, video monitor 72, keyboardterminal 74, and printer 76.

Generally, transport subsystem 12 is provided to move a multitude ofophthalmic lenses along a predetermined path to move each of thoselenses, one at a time, into a lens inspection position, and FIG. 1 showsone such lens 80 in this lens inspection position. Illuminationsubsystem 14 is provided to generate a series of light pulses and todirect a respective one light pulse onto light path 82 and through eachophthalmic lens moving through the lens inspection position. Subsystem16 generates a set of signals representing selected portions of thelight pulses transmitted through the ophthalmic lens and then transmitsthese signals to processing subsystem 20. The image processing subsystemreceives those signals from subsystem 16 and processes those signalsaccording to a predetermined program to identify at least one conditionof each of the lenses that is inspected; and in the preferred embodimentof subsystem 20 described below in detail, that subsystem determineswhether each inspected lens is acceptable for consumer use.

System 10 may be used to inspect a large variety of types and sizes ofophthalmic lenses. The system is particularly well-suited for inspectingcontact lenses, and FIGS. 2 and 3 illustrate, for example, contact lens84 that may be inspected by system 10. Lens 84 has a generallyhemi-spherical shape, including front and back surfaces 86 and 90; andthe lens forms a central optical zone 84a and an outer zone 84b. Thelens has a substantially uniform thickness; however, as particularlyshown in FIG. 3A, the thickness of the lens gradually decreases over theannulus 84C immediately adjacent the outside edge of the lens.

FIG. 4 illustrates transport subsystem 12 in greater detail; and asdiscussed above, this subsystem preferably includes lens carrier 22 andsupport assembly 24. More specifically, this support assembly includestranslation table 92 and first and second stepper motors 94 and 96, andthe translation table, in turn, includes base member 100 and frames 102and 104.

Generally, lens carrier 22 is provided to hold a multitude of theophthalmic lenses, and FIGS. 5 and 6 show the lens carrier in greaterdetail. As shown therein, the lens carrier includes a rectangular basemember 106 and an array of lens inspection cups 110 connected to thebase member. Preferably, each cup consists of a frusto-conical sidewall110a and a hemi-spherically shaped bottom portion 110b integrallyconnected to and extending downward from the sidewall of the cup Inaddition, the bottom portion of each cup preferably has a constantradius of curvature, approximately 10% larger than the radius ofcurvature of the ophthalmic lens 84 placed in the cup, and the diameterof the bottom portion 110b is greater than the diameter of theophthalmic lens. Also, the sidewall of each cup extends at a slope ofabout 20° with respect to the axis of the cup, and the thickness of eachsidewall is preferably less than about 0.010 inches.

With the particular lens carrier 22 shown in FIGS. 5 and 6, the diameterof the top of each cup 110 is about 22 mm; and the depth of each cup ispreferably greater than the diameter of the lens to be inspected, which,for contact lenses, is typically 20 mm. As shown in FIGS. 5 and 6, thelens carrier includes a 3×4 array of inspection cups. As will beunderstood by those of ordinary skill in the art, the inspection cupsmay be arranged in other rectangular configurations; and for instance,the cups may be arranged in a 3×3 array, a 3×8 array, a 4×8 array, a3×10 array, or a 4×10 array.

Cups 110, and preferably base member 106, are made of a substantiallytransparent material, such as polyvinyl chloride plastic. Moreover,preferably cups 110 and base member 106 are integrally molded togetherand are relatively thin, which reduces the cost and thus, as a practicalmatter, allows the carrier to be disposed after a single use. Disposingof the carrier after a single use substantially reduces or eliminatesthe formation of scratches in the cups, which are often made when lensinspection cups are reused. Since, as discussed below, a scratch on acup may be interpreted as a flaw or defect in the lens inside the cup,the use of readily disposable lens carriers improves the accuracy of thelens inspection process.

In use, each cup 110 is partially filled with a fluid solution 112 suchas, for example, a saline solution, and a respective one ophthalmic lensis placed at the bottom of each cup, fully submerged in the solutiontherein. When a lens is placed in a cup, the cup tends to center thelens automatically therein at the bottom of the cup, due to theabove-described shape and parameters of the cup.

With reference again to FIG. 4, support assembly 24 is provided tosupport the lens carrier and to move the lens carrier so as to move eachof the lenses therein, one at a time, into the lens inspection position.Preferably, support assembly 24 moves lens carrier 22 continuously alonga predetermined path to move lenses 84 smoothly into and through thatlens inspection position. For instance, the support assembly may bedesigned to move the lens carrier so that cups 110 of that carrier aremoved through the lens inspection position, one row of cups at a time;and after each row of cups is passed through the lens inspectionposition, support assembly 24 moves carrier 22 to align another row ofcups with the lens inspection position.

With the preferred support assembly 24 shown in FIG. 4, frame 102 oftranslation table 92 is supported by base 100 for lateral movementthereon, to the right and to the left as viewed in FIG. 4; frame 104 issupported by frame 102 for movement thereon, upward and downward asviewed in FIG. 4; and lens carrier 22 is supported on frame 104 formovement therewith. Stepper motor 94 is mounted on base 100 andconnected to frame 102 to move that frame across the base member, andstepper motor 96 is mounted on frame 102 and connected to frame 104 tomove this latter frame.

Any suitable frames 102 and 104 and stepper motors 94 and 96 may be usedin support assembly 24. Moreover, as will be understood by those ofordinary skill in the art, other suitable support assemblies are knownand may be used to move lens carrier 24 in the desired manner.

With reference again to FIG. 1, subsystems 14 and 16, together, produceand then utilize an effect referred to as dark field illumination toinspect the ophthalmic lenses moving through the lens inspectionposition. In this procedure, an image is formed on pixel array 46 offeatures of the ophthalmic lens that scatter or reflect lighttransmitted through the lens. Dark field illumination may be used--andindeed is a highly effective procedure--to detect flaws orirregularities in ophthalmic lenses because essentially all defects, aswell as some normal features, of the ophthalmic lenses scatter light;and even very subtle, shallow defects, such as those referred to aspuddles, can be readily detected by using a dark field illuminationprocedure.

The principle of dark field illumination may be understood withreference to FIG. 7, which shows an ophthalmic lens 114, a collimatedlight beam 116, a pair of lenses 120 and 122, an opaque stop 124, and apixel array 126. Light beam 116 is transmitted through ophthalmic lens114 and then is incident on imaging lens 120. If the illumination beam116 were perfectly collimated when incident on lens 114, then that beamwould be brought to a focus at the back focal point of lens 120. Even ifthe illuminating beam 116 is completely unaffected by ophthalmic lens114, though, that beam is not perfectly collimated when incident on lens120, and the beam 116 forms a small circle, referred to as a circle ofleast confusion, at approximately the back focal point of lens 120. Stop124 is located on the other side of imaging lens 120, at this back focalpoint thereof, and the size of the stop is selected to be slightlylarger than that circle image formed by the illuminating beam 116 at theback focal point of lens 120.

Thus, in the absence of any scattering or refraction of illuminationbeam 116 by lens 114, no light is transmitted past stop 124, and pixelarray 126 is completely dark. However, any feature of lens 11.4 thatdeflects light enough to miss the stop 124, will cause some light to beincident on the pixel array. The ophthalmic lens 114 is located at aposition that is optically conjugate to the position of the pixel array126; and thus, if any light is transmitted past stop 124, that lightforms an image on the pixel array of the entity of ophthalmic lens 114that scattered the light.

FIG. 8 shows the preferred apparatus for producing and then utilizingthis dark field illumination effect in system 10; and in particular,this figure shows the preferred illumination subsystem and imagingsubsystem in greater detail. As shown in this figure, subsystem 14includes housing or casing 26, light source 30, mirrors 32 and 34,diaphragm 130, power supply 132, control circuit 134, first and secondadjustable support means 136 and 140, and exit window 142. Also,subsystem 16 includes camera 36, stop 40, and lens assembly 42. Morespecifically, camera 36 includes housing 44, pixel array 46, and shutter50; and lens assembly 42 includes housing 52, lenses 54 and 56, andbaffles 60.

Housing 26 of subsystem 14 provides a protective enclosure for otherelements of this subsystem; and light source 30, mirrors 32 and 34, anddiaphragm 130 are all secured in that housing. More specifically,housing 26 includes a main vertical leg 26a and top and bottomhorizontal legs 26b and 26c, and light source 30 is positioned insidethe main leg of the housing. Mirror 32 is secured in the intersection oflegs 26a and 26c, mirror 34 is positioned adjacent the distal end of leg26c, and diaphragm 130 is positioned inside leg 26c, between mirrors 32and 34. Housing 26 also forms an opening 26d directly above mirror 34,and window 142 is secured in that opening. In use, light source 30generates a multitude of light flashes or pulses and directs each ofthose pulses onto light path 82. Mirror 32 is located on this path anddirects the light pulses through diaphragm 130 and onto mirror 34, whichin turn directs the light pulses upwards, through window 142, throughthe lens inspection position, referenced at 144 in FIG. 8, and toward oronto imaging subsystem 16.

Preferably, light source 30 is mounted on adjustable support means 136that allows the specific direction of the light emitted from that lightsource to be adjusted, and mirror 34 is mounted on another adjustablesupport means 140 that allows both the specific direction and thespecific position of the light reflected from that mirror to beadjusted. More particularly, with the preferred embodiment of subsystem14 shown in FIG. 8, support means 136 includes a tilt stage that issecured to housing 26 and is pivotal about two mutually orthogonalhorizontal axes. Also, with this embodiment of subsystem 14, mirrorsupport means 140 includes tilt stage 140a and translation stage 140b;and mirror 34 is mounted on the former stage, which in turn is mountedon the latter stage. Stage 140b is movable laterally, to the left and tothe right as viewed in FIG. 8, allowing the lateral position of mirror34 to be adjusted; and stage 140a is pivotal about two mutuallyperpendicular horizontal axes, also allowing the specific angle ofmirror 34 to be adjusted.

Imaging subsystem 16 receives light pulses transmitted through theophthalmic lenses located in the lens inspection position 144, andgenerates a series of signals representing selected portions of thelight transmitted array 46 is disposed inside camera housing 44,directly behind shutter 50; and the pixel array is preferably comprisedof a multitude of light, sensors each of which is capable of generatinga respective one electric current having a magnitude proportional to orrepresenting the intensity of light incident on that sensor.

FIG. 9 is an enlarged view of a small portion of pixel array 46, and inparticular, shows a multitude of individual light sensors of the pixelarray. With reference to this Figure, preferably these light sensors, orpixels, are arranged in a uniform grid of a given number of rows andcolumns, and for example, that grid may consist of, one million pixelsarranged in one thousand columns and one thousand rows. Preferably, inthat grid, the pixels form a multitude of uniformly spaced rows and amultitude of uniformly spaced columns; and, except for those pixelsalong the very edge of the array, each pixel has eight immediateneighbors. For example, pixel 146a has eight neighbors: pixel 146blocated directly above, pixel 146c located directly below, pixels 146dand 146e located directly to the left and to the right respectively, andpixels 146f, 146g, 146h, and 146i located, respectively, above and tothe right, above and to the left, below and to the right, and below andto the left.

With reference again to FIG. 8, stop 40 and lenses 54 and 56 are locatedforward of shutter 50 and are coaxially aligned with each other and withpixel array 46 and the camera shutter. Stop 40 is positioned betweenlenses 54 and 56 and substantially at the back focal plane of lens 54,and lens 56 is positioned so that the pixel array is at the back focalplane of this lens 56. Preferably, lenses 54 and, 56 and stop 40 aremounted inside housing 52, which in turn is mounted on the front end ofcamera 36. In addition, baffles 60, which may comprise a series ofring-shaped members, are preferably mounted in and spaced along thelength of housing 52 to help collimate the light travellingtherethrough.

With this specific position of lenses 54 and 56 and stop 40, most or allof the light beam transmitted through a particular ophthalmic lens beinginspected is focused by lens 54 onto stop 40, and is thus not incidenton pixel array 46. However, some of the light passing through irregularfeatures of the ophthalmic lenses, as well as some of the light passingthrough regular features of some ophthalmic lenses, may be deflectedsufficiently so that this light is not focused onto stop 40 by lens 54,but instead is transmitted past that stop and is incident on the pixelarray 46. In addition, the lens inspection position is located at aposition that is optically conjugate to the position of pixel array 46,and thus any light that is transmitted past stop 40 forms an image onthe pixel array of the entity of the ophthalmic lens that scattered thatlight.

This dark field illumination technique is a very effective way toilluminate irregularities in ophthalmic lenses; and FIG. 10 shows theimage formed on pixel array 46 by a beam of light transmitted through anophthalmic lens, and in particular, through a contact lens 84 shown inFIGS. 2 and 3. Most of the light transmitted through the lens is blockedfrom the pixel array by step 40. However, due to the non-uniformthickness of annulus 84c of the lens, the light transmitted through thisportion of the lens is deflected past stop 40 and is incident on pixelarray 46, forming a picture of the annulus on that array. Otherirregularities in lens 84 also produce illuminated areas on the pixelarray. For instance, even subtle, shallow defects, such as puddles canbe seen on the pixel array. In particular, if a puddle is present in theinterior of the lens, then the puddle will readily appear on the pixelarray as a bright outline on a dark field; and if a puddle is present inthe peripheral zone of a lens, then the puddle will readily appear onthe pixel array as dark lines on a bright field. Also, since theperipheral zone of the contact lens has a wedge-shaped cross-section,that peripheral zone deflects enough light past stop 40 to cause theentire zone to appear on pixel array 46 as a bright white annulus 150 ona dark field.

As will be understood by those of ordinary skill in the art, anysuitable light source, lenses, and camera may be used in subsystems 14and 16. For instance, the light source 30 may be a short-arc xenon flashlamp made by Hamamatsu. This particular flash lamp has a uniquecombination of arc stability and longevity, and the output of this flashlamp is rated plus or minus 2%, with a lifetime of 10⁹ flashes,

Further, with an embodiment of subsystem 16 that has been actuallyreduced to practice, first imaging lens 54 is a 100 mm focal lengthachromatic lens that is diffraction-limited for objects within 2.5° ofthe optical axis of the lens, and the lens 54 is mounted in ablack-anodized, aluminum tube, with internal baffles 60 to eliminatedegradation of contrast due to the reflection of light from the insidewalls of the tube. The second lens 56 is a standard 50 mm focal lengthF-1.8 Nikon lens. The end of the barrel for the first lens 54 iscemented onto an ultraviolet haze filter, which is threaded into thehousing of the 50 mm lens.

Opaque stop 40 is a small plastic circle with a diameter of 0.100inches, and includes an adhesive backing to secure the stop in place.Suitable stops are commercially available and are used as solder padmasks in manual layout of art work for printed circuit boards, and thesestops are available in a large variety of sizes. The preferred size ofstop 40 may vary depending on other parameters of system 10, and theselected size of the stop is preferably chosen to provide the bestcompromise between contrast, ease of alignment, and sensitivity tovibration.

The camera used in the subsystem 16 that has been actually constructed,is a high-resolution camera sold by Videk, and that accepts a standardNikon mount lens. The F-1.8 50 mm Nikon lens 56 is first mounted oncamera 36, and then the housing of lens 54 is threaded onto the lens 56.The effective field of view of this Videk camera is 13.8×13.8 mm, whichis, for example, about 10-1.5% larger than the maximum contact lenssize. It is desirable that the ophthalmic lens being inspected occupy asmuch of the field of view of camera 36 as possible in order to optimizethe accuracy of the inspection. Hence, by automatically centering thelens to be inspected, the inspection cups 110 of lens carrier 22 makemaximum use of the resolution available in the camera.

The preferred configurations of subsystems 14 and 16 have a number ofadvantages. First, because light path 82 is folded, the flash lamp 30may be placed a larger distance from the ophthalmic lens that is at thelens inspection position 144, and this produces a highly collimated beamof light at that ophthalmic lens. Second, the size of the image of thearc on the stop 40 is substantially equal to the physical size of thearc, multiplied by the ratio of (i) the distance from lamp 30 to lens 54to (ii) the distance from lens 54 to stop 40. The preferredconfiguration shown in FIG. 8 also minimizes the arc image size,allowing the use of a smaller stop and consequently producing greatersensitivity. Third, iris diaphragm 130 limits the cross-sectional areaof light beam 82 and thus the area that is illuminated by that beam.Preferably, diaphragm 130 is used to adjust the cross-sectional area orsize of beam 82 so that the beam illuminates a circular area about only10 to 15% larger than the diameter of the ophthalmic lens beinginspected. Limiting the size of the illumination beam 82 improves thecontrast between the image produced on the pixel array and the rest ofthat array; and in particular, limiting the size of beam 82 eliminatesor substantially reduces the amount of light that scatters fromartifacts of the lens inspection cup. This scattered light might appearas background light on pixel array 46, reducing the contrast between theimage of interest on the pixel array and the rest of that array.

In addition, with the preferred configuration of subsystems 14 and 16,the magnification factor of the system--that is, the ratio of the sizeof the image of the ophthalmic lens on the pixel array 46 to the actualsize of that ophthalmic lens--is approximately equal to the ratio of thefocal length of the second lens 56 to the focal length of the first lens54. The actual magnification factor also depends upon the distancebetween the lenses 54 and 56 and the distance of the ophthalmic lensbeing inspected from the first imaging lens 54. In addition, tilt stage140a and translation stage 140b allow the center of the output beamreflected off of mirror 34 to be adjusted to coincide with the axis ofthe imaging optical subsystem 16.

As described above, imaging subsystem 16 includes two lenses 54 and 56,separated by approximately the focal length of the first lens 54. Theuse of two lenses is not necessary; however, this is preferred becausethe use of two lenses provides for a greater control over variousparameters of subsystems 14 and 16, and for example, it decouples theseparation between the back focal plane and the image plane from themagnification of the subsystems.

FIGS. 11A, 11B, and 11C illustrate alternate optical configurations,generally referenced at 152, 154, and 156 respectively, that may beemployed in system 10 for directing light beam 82 through the lensinspection position and the ophthalmic lens held in that position, andonto stop 40 and pixel array 46.

Configuration 152 includes only one lens 160, which simultaneouslyimages light beam 82 onto stop 40 and images the lens being inspectedonto pixel array 46. More specifically, the optical configuration shownin FIG. 11A includes mirror 162, imaging lens 160 and stop 40; and theFigure also shows a lens holder, schematically represented at 164, anophthalmic lens 166 to be inspected and pixel array 46. With thisconfiguration, light beam 82 or pulses from light source 30 is directedto mirror 162, which in turn directs the light through lens 166 and ontoimaging lens 160. Most of the light directed to lens 160 is focusedthereby onto stop 40; however certain features of lens 166 will deflectlight sufficiently so that this deflected light is transmitted past stop40 and is focused on pixel array 46, producing thereon an image of thefeatures of liens 166 that caused, the light to be transmitted past stop40. The configuration of FIG. 11A may be the preferred configuration ifthe CCD screen of camera 36 is larger than the CCD screen of theabove-mentioned high-resolution Vidik camera.

With configuration 154 of FIG. 11B, the functions of imaging the lightsource onto stop 40 and imaging the ophthalmic lens being inspected ontopixel array 46 are separated. To elaborate, this configuration includesmirror 170, lenses 172 and 174 and stop 40; and FIG. 11B also shows lensholder 164, ophthalmic lens 166 and pixel array 46. In thisconfiguration, light beam 82 from light source 30 is directed ontomirror 170, and this mirror directs the light beam to lens 172. Lens 172directs the light through ophthalmic lens 166, and most of the lighttransmitted through lens 166 is focused on stop 40. Some features oflens 166 deflect light away from stop 40, however; and this deflectedlight is incident on lens 174, which focuses that light onto pixel array46, producing thereon an image of the feature of lens 174 that deflectedthe light past stop 40. An advantage of the lens arrangement of FIG. 11Bis that the actions of the two lenses 172 and 174 are completelyindependent.

Optical configuration 156 shown in FIG. 11C is very similar to theoptical configuration shown in FIG. 8; however configuration 156 doesnot include mirror 32 or diaphragm 130. More particularly, configuration156 includes mirror 176, lenses 180 and 182 and stop 40; and FIG. 11Calso shows lens holder 164, ophthalmic lens 166 and pixel array 46. Withthe arrangement of FIG. 11C, light beam 82 from light source 30 isdirected onto mirror 176, which directs the light through lens 166 andonto first first lens 180. Most of the light directed to lens 180 isfocused onto stop 40; however some features of lens 166 deflects lightsufficiently so that this light is transmitted past stop 40 and ontosecond lens 182, and this lens 182 focuses this light onto pixel array46. In this configuration, lens 180 images the light source onto stopindependent of lens 182. Both lenses 180 and 182, however, are involvedin imaging any defects in lens 166 onto pixel array 46.

In addition to the foregoing, system 10 also preferably includes acontrol subsystem to synchronize the operation of illumination subsystem14 and imaging subsystem 16 with the operation of transport subsystem12; and, in particular, to actuate the light source 30 to generate alight pulse, and to open camera shutter 50, when a lens is in the lensinspection position 144. The preferred control subsystem is illustratedschematically in FIG. 12A. With this preferred control subsystem,transport subsystem 12 generates an electric signal each time one of thelens inspection cups is in the lens inspection position. This signal maybe generated, for example, by stepper motor 94, or by another drivemeans for translation table 92, or by a limit switch that is engagedeach time one of the lens inspection cups reaches the lens inspectionposition. Preferably, this signal is transmitted to camera shutter 50 toopen that shutter, and also transmitted to a delay circuit 184 thatdelays the electric signal for a short period, to allow the camerashutter to open completely, and after this short delay, this electricsignal is then transmitted to a lamp driver 134 that then actuates lightsource 30.

For example, with an embodiment of system 10 that has been constructed,and with reference to FIG. 12B, when an ophthalmic lens is in the lensinspection position, the transport subsystem generates and transmits a24 volt pulse both to camera 36 and to delay circuit 184. The camerashutter opens in response to the leading edge of this pulse, and takesabout 9 milliseconds to open completely. The delay circuit delayspassage of the signal to lamp driver 134 for about 15 milliseconds; andafter this delay, this trigger pulse is transmitted to the lamp driver.The leading edge of this trigger pulse actuates an SCR, which ignitesthe flash lamp 30. At this point of ignition, the lamp becomeselectrically conductive, and a previously charged capacitor isdischarged across the lamp. The capacitance and voltage to which thatcapacitor were charged determine the total light energy emitted by thelamp and the duration of the light pulse. Meanwhile, an interfacecircuit holds the camera shutter open for about 30 milliseconds and thencloses the shutter.

The use of a camera shutter in the above-described manner avoids orsubstantially reduces the integration of ambient light in pixel array 46between lens inspections. Also, preferably, the high voltage powersupply, lamp driver electronics and storage capacitor are mounted in thehousing structure 26 that contains the illumination optics.

The light from lamp 30 is sufficient to allow the capture of an image onpixel array 46 in such a short period of time that it is not necessaryto stop the ophthalmic lens being inspected. Thus, the transportsubsystem 12 is preferably designed to move an array of ophthalmiclenses continuously under the imaging subsystem 16. This continuous,smooth movement of the ophthalmic lens array is advantageous because itreduces or eliminates the development of ripples or other disturbancesof the top of the solution 112 in cups 110, which might interfere withthe imaging process.

As will be understood by those of ordinary skill in the art, the desiredsynchronization or coordination between transport subsystem 12,illumination subsystem 14, and imaging subsystem 16 may be achieved inother ways. For instance, light source 30 may be activated and shutter50 may be opened at predetermined time intervals that are chosen tocoincide with the positioning of a lens in the lens inspection position144.

The illumination, imaging, and transport subsystems may be enclosedwithin a housing (not shown) to minimize the effects of airborne debrison the illumination and imaging processes. That housing may be providedwith transparent front doors or with front doors having transparentwindows to provide access to and to allow observation of the interior ofthe housing, and the transparent portions of those front doors may betinted to minimize the effects of ambient room light on the illuminationand imaging processes.

FIG. 13 is a block diagram illustrating image processing subsystem 20.In this subsystem, the electric signals from the pixel array areconducted, in a combination of a series and parallel formats, topre-processor 62. These electric signals being transmitted topre-processor 62 may be identified in any suitable way with the specificpixels that generated the signals. For instance, the signals from thepixels of camera 36 may be transmitted to pre-processor 62 in a given,timed sequence, and a clock signal may also be transmitted to thepreprocessor from the camera to identify the start, or selectedintervals, of that sequence. Alternately, each signal transmitted toprocessor 62 may be provided with a header or another data tagidentifying the particular pixel that generated the signal.

Unit 62 converts each electric current signal from each pixel of array46 into a respective one digital data value, I₀, and stores that datavalue at a memory location having an address associated with the addressof the pixel that generated the electric signal. These data values areavailable to processor 64 and may be transmitted thereto via bus lines186. Preferably, as discussed in detail below, a plurality of additionalsets of data values I₁ . . . I_(n) are generated, with each data sethaving a respective one data value associated with each pixel of array46, and pre-processor 62 may include a multitude of memory sections, orboards, each one of which is used to store a respective one set of thesedata values.

Processor 64 is connected to preprocessor 62 via bus lines 186 to obtaindata values from and to transmit data values to that preprocessor. Asexplained in greater detail below, processor 64 is programmed to processand analyze the data values stored in the preprocessor to identify atleast one condition or parameter of each lens inspected by system 10,and for example, to indicate whether each lens is acceptable forconsumer use.

Memory disk 70 is connected to processor 64 to receive and to hold datavalues on a permanent or semi-permanent basis. For instance, memory disk70 may be provided with various look-up tables used by processor 64, andthe memory disk may be used to store data relating to or obtained in thelens inspection process. For example, memory disk 70 may be used to keeptrack of the total number of lenses inspected during a given day or timeperiod, and to keep track of the total number, type, and size of anydefects found in any given sample or group of lenses.

Keyboard 66 is connected to processor 64 to allow operator inputthereto, and keyboard terminal 74 is used to display visually data ormessages being input into the processor. Monitor 72 is connected topreprocessor 62 and is provided to produce video images from the datavalues stored in the preprocessor. For example, the I₀ data values maybe transmitted to monitor 72 to produce thereon an image of the realimage produced on pixel array 46. Others of the sets of data values I₁ .. . I_(n) may be transmitted to monitor 72 to produce refined orprocessed images of that real image. Printer 76 is connected toprocessor 64, via serial-parallel converter 190, to provide a visual,permanent record of selected data values transmitted to the printer fromprocessor 64. As will be understood by those of ordinary skill in theart, subsystem 20 may be provided with other or additional input andoutput devices to allow an operator or analyst to interact withprocessor 64, preprocessor 62, and memory unit 70.

The individual components of subsystem 20 are conventional andwell-known by those of ordinary skill in the art. Preferably, processor64 is a high-speed digital computer, and monitor 72 is a high resolutioncolor monitor. Also, for example, preprocessor 62 may be an assembly ofDatacube signal processing boards, and processor 64 may be a Sun 3/140work station.

As discussed above, each time an ophthalmic lens passes directly beneathcamera 36, light is transmitted through the ophthalmic lens and focusedon pixel array 46, and each pixel of array 46 generates a respective oneelectric output current having a magnitude representing the intensity ofthe light incident on that pixel. This output current for each pixel isconverted to a digital data value that is stored in an address inpreprocessor memory associated with the pixel. These digital datavalues, referred to as the I₀ values, are processed, as described below,to determine whether the lens passing beneath the camera 36 includes oneor more of a selected group of features; and in particular, to determinewhether that lens contains any feature that may be considered as a flawor defect that renders the lens unsuitable for consumer use.

FIG. 14 shows the major components of a preferred image processingprocedure to identify any defects in the type of lens 84 shown in FIGS.2 and 3. After the lens image is acquired on the pixel array, that imageis tested, in a procedure referred to as decentration, to determine ifthe inside and outside circumferential edges of annulus 84c of the lensare properly centered relative to each other, and this decentration testinvolves fitting first and second circles to the inner and outer edgesof the annulus produced on the pixel array. After this, the actual edgesof the annulus are found or extracted. Then, a first masking procedureis used to reduce or eliminate data associated with light refracted ordeflected by the periphery of the lens inspection cup, and any edgedefects are highlighted by a procedure referred to as the rubber bandalgorithm. Next, any defects are further emphasized by proceduresreferred to as fill-in and clean-up and by a second mask procedure thateliminates data associated with certain pixels near the center of theannulus image.

After any possible defects are emphasized or highlighted, a search ismade to determine if in fact any defects exist. In particular, thepixels of array 46 are searched--or, more precise, data valuesassociated with those pixels are searched--to identify line segments, orrunlengths, of pixels that may be part of a defect, and those runlengthsare then clustered to identify defect candidates. Then, the sizes andlocations of these defect candidates are analyzed to determine if theyare actual defects that make the lens unsuitable for consumer use.

As mentioned above, the decentration test is used to determine whetherthe inside and outside circumferential edges of annulus 84c of the lenspassing beneath the camera are concentric. Generally, with reference toFIG. 15, this is done by making a multitude of scans 202 across thepixel array 46--or, more precisely, by studying data values at addressesin the preprocessor memory that correspond to the addresses of pixels inselected line segment on array 46--to determine whether the outside andinside edges 150a and 150b of annulus 150 are concentric.

FIGS. 16a and 16b illustrate the decentration test or routine R₁. Thefirst step 204 in this routine is referred to as a thresholdingsubroutine; and the purpose of this routine is to associate each pixelwith a new intensity value I₁ equal to either the maximum or minimumillumination values, T_(max) or T_(min), depending on whether theoriginal illumination value I₀ of the pixel is, respectively, above orbelow a given threshold value T_(t). Thus, for example, each pixelhaving an original illumination value I₀ greater than 127 may beprovided with a new illumination value I₁ of 255, and each pixel havingan original illumination value of 127 or less may be provided with a newillumination value I₁ of zero.

The next step 206 in the decentration test is to set the number,locations, and sizes of the scans 202 used in this test, and this isdone by providing the processor 64 with the address of the startingpixel and the length and direction of each scan. These parameters arechosen so that, unless the lens is badly decentered, each of a multitudeof the scans cross both edges of annulus 150. Preferably, processor 64or memory disc 70 is provided with a semi-permanent record of thesestarting addresses, directions and scan lengths. This record is usedduring the inspection of each lens of a given nominal type or size, andthis semi-permanent record may be changed when lenses of a differentnominal type or size are inspected.

Next, at step 210, the selected scans are made across the pixel array ordisplay 46. Unless a lens is badly decentered, most of these scans willcross an illuminated portion of that display. When a scan crosses anilluminated portion of the display, the addresses of the first and lastpixels of the line segment crossing that illuminated portion and thelength of that line segment, referred to as the run length, are recordedin a file f₁. Subroutines for detecting the first and last pixels in arun length, for obtaining the addresses of those pixels, and fordetermining the length of each run length, are well-known by those ofordinary skill in the art, and any such suitable routines may beemployed in the decentration test.

Then, at step 212, the length of each of these run lengths is comparedto a predetermined value, and the data--that is, the addresses of thefirst and last pixel in the run length and the length of the runlength--associated with each run length less than that predeterminedvalue, are discarded. This discarding is done to eliminate, or at leastto reduce the amount of, data caused by noise on the pixel array46--that is, undesirable light that is incident on the pixel array. Toelaborate, noise, which may be due to background light or to light thatis deflected off the desired light path by dust or other particles, mayproduce illuminated areas on the pixel array. In the vast majority ofinstances, each of these illuminated areas consists of only one or asmall group of adjacent pixels. If one of the above-mentioned scans madeduring step 210 crosses such an illuminated area, then the processorrecords the addresses of the first and last pixel of and the length ofthe run length across that illuminated area. This illuminated area andthe associated data, however, are not related to annulus 162 or to theedges thereof, and thus step 212 is provided to eliminate this data.

The next step 214 in the decentration test is to identify each of theremaining pixel addresses as being on the outer edge or the inner edgeof the annulus, and any suitable subroutine may be employed to do this.For instance, the addresses of the first and last pixel of each runlength may be compared to each other; and, the pixel closer to thecenter of the entire pixel array 46 may be considered as being on theinner edge of annulus 162, while the pixel further away from the centerof the pixel array may be considered as being on the outer edge of theannulus. Alternatively, the scans may be separated into two groups suchthat for each scan in the first group, if an illuminated run length isfound during the scan, the first and last pixels in the run length areon the outer and inner edges, respectively, of the annulus; and for eachscan in the second group, if an illuminated run length is found duringthe scan, the first and last pixels in the run length are on the innerand outer edges, respectively, of the annulus.

After each pixel is determined to be on the inside or the outside edgeof annulus 162, then at step 216 the number of pixels that have beenfound on each edge is counted. If either of these numbers is less thanthree, then at step 220, the lens is rejected on the basis that thelens, is badly decentered. If, though, at least three pixels have beenfound on each edge, then at step 222, a subroutine is invoked, first, tofit a first circle onto the pixels that were found on the outside edgeof the annulus, second, to fit a second circle onto the pixels that werefound on the inside edge of the annulus, and third to determine thecenters and radii of these two circles. Numerous subroutines arewell-known for fitting a circle onto three or more points and tocalculate the center and radius of that circle, and any such subroutinemay be used in the decentration test at step 222.

After the centers of these two fitted circles are calculated, thedistance d between these two centers is determined at step 224. Thisdistance is then compared, at step 226, to a first value d₁ ; and if thedistance is greater than d₁, then the lens is rejected at step 230 asbeing badly decentered. If the distance d is less than d₁, then, at step232, that distance d is compared to d₂, which is the maximum acceptabledistance between the centers of the inner and outer edges of annulus150. If the distance d between centers of the fitted circles is greaterthan d₂, then the lens is rejected, at step 234, as being decentered ;however, if the distance d is equal to or less than d₂, then the lenspasses the decentration test, as indicated by step 236.

If a lens passes the decentration test, processor 64 then initiates aprocess or routine R₂, referred to as edge detector, to produce a set ofillumination values that, in turn, may be used to identify the pixels onthe edges of annulus 150. Typically, these edges are not perfect circlesand thus are different from the fitted circles found during thedecentration test. This new set of illumination values is obtainedthrough a series of morphological operations or changes in the originalintensity values assigned to or associated with each pixel of array 46.These morphological changes are pictorially illustrated in FIGS. 17athrough 17i, and shown in the form of a flow chart in FIG. 18. Morespecifically, FIG. 17a shows an image of annulus 150 on pixel array 46;and FIG. 17b shows an enlarged view of a portion of that annulus, andalso shows a short line segment 240, or scan, across that annulusportion and the adjacent areas of the pixel array FIG. 17c illustratesthe intensity values I₁ of the pixels in that scan 240; and asrepresented therein, the pixels in the dark areas of FIG. 17b have alower or zero I₁ value, and the pixels in the light areas of FIG. 17bhave a higher I₁ value, such as T_(max).

With reference to FIG. 18 and FIGS. 17c and 17d, in the first step 242of the edge detector process, a new value I₂ is calculated for eachpixel; and, in particular, the I₂ value for each pixel is set equal tothe average of the I₁ values of that pixel and its eight immediatelyadjacent pixel neighbors. The difference between the I₁ and the I₂values for the pixels in array 46 is that the latter values change moregradually between the pixels having the lowest I₂ value (which generallyare those pixels in the dark areas of the pixel array), and the pixelshaving the highest I₂ value (which generally are-those pixels in thelight areas of array 46). This difference may be best understood bycomparing FIGS. 17c and 17d.

Then, at step 244, a further value I₃ is determined for each pixel; andspecifically, the I₃ value for each pixel is set equal to the minimum I₂value of that pixel and its eight immediately adjacent pixel neighbors.With reference to FIGS. 17d and 17e, the I₃ values may vary across thescan 240 in a manner very similar to the way in which the I₂ values varyacross that pixel scan. The principle difference between the manner inwhich the I₂ and I₃ values of the pixels vary across the pixel array isthat the band of pixels having the highest I₃ value is slightly narrowerthan the band of pixels having the highest I₂ values.

The next step 246 in the edge detector process is to determine a stillfurther value I₄ for each pixel according to the equation I₄ =I₂ -I₃.With particular reference to FIG. 17f, most of the pixels in the scan240 have I₄ values of zero; however, the pixels on and radiallyimmediately inside the two edges of annulus 162 have positive I₄ values.Next, at step 250, an I₅ value is determined for each pixel; and morespecifically, the I₅ value of each pixel is set equal to the maximum I₂value of the pixel and its eight immediately adjacent pixel neighbors.For most of the pixels on the pixel array 46, the I₅ value of the pixelis the same as the I₂ value of the pixel. However, for the pixels withina given distance of the edges of annulus 150, the I₅ values of the pixelare greater than the I₂ values of the pixel, and the band of pixelshaving the highest I₅ value is slightly wider than the band of pixelshaving the highest I₂ value.

The next step 252 in the edge detector process is to determine a stillfurther value I₆ for each pixel according to the equation I₆ =I₅ -I₂.With particular reference to FIG. 17h, most of the pixels on the pixelarray will have I₆ values of zero; however, the pixels on and radiallyimmediately outside the two edges of annulus 150 have positive I₆values. Next, at step 254, an I₇ value is assigned to each pixel; andmore specifically, the I₇ value of each pixel is set equal to thesmaller of the I₄ and I₆ values for the pixel. With reference to FIG.17i, most of the pixels on the pixel array have an I₇ value of zero;however, the pixels directly on and immediately adjacent the two edgesof annulus 150 have positive I₇ values. In this way, the I₇ values ofthe pixels identify the pixels that are on the edges of annulus.

A thresholding subroutine may then be invoked at step 256 to sharpen thedistinction between the pixels on the edges of annulus 150 and the otherpixels in display 46. In particular, each pixel may be assigned a stillfurther value I₈ equal to either the maximum illumination intensityvalue T_(max) or the minimum illumination intensity value T_(min)depending on whether the I₇ value of the pixel is, respectively, aboveor below a given threshold value such as T_(t). Thus, for instance, eachpixel having an I₇ value greater than 32 may be provided with an I₈value equal to 255, and each pixel having an I₇ value of 32 or less maybe provided with an I₈ value of zero.

FIG. 17j shows each pixel of array 46 illuminated at an intensity equalto its I₈ value.

During the calculation and processing of the I₁ -I₈ values, preferablyeach set of pixel values is stored in a respective one memory registerin preprocessor 62--that is, for example, the I₀ values are all storedin a first register, the I₁ values are all stored in a second register,and the I₂ values are all stored in a third register. It is notnecessary to store all of the I₁ -I₈ values during the entire processingperiod for each lens, however; and, for instance, during each processingperiod, the I₃ values may be discarded after the I₄ values arecalculated, and the I₅ values may be discarded after the I₆ values aredetermined.

In addition, it is not necessary to calculate I₂ -I₈ values for all thepixels in the array 46. For any ophthalmic lens of a given type, theannulus of the lens will appear in a relatively well-defined region orarea of the pixel array 46, and it is only necessary to determine the I₂-I₈ values for the pixels in that region or area. However, as apractical, matter, it may often be easier simply to calculate the I₂ -I₈values for all the pixels in array 46, rather than to add a furtherprocessing step to identify those pixels in the given area of interest.

After the edge detector routine is completed, the lens inspection systeminvokes a masking routine to produce a set of pixel illumination valuesthat is free of the effect produced by the edge of the lens inspectioncup used to hold the lens. To elaborate, as an ophthalmic lens isilluminated by a flash of light from flash lamp 30, light is alsotransmitted through the cup holding the lens. The edge of the cup maydiffract some of this light sufficiently enough to transmit the lightpast stop 40 and onto the pixel array 46, producing thereon an image ora partial image of the edge of the cup, as shown at 260 in FIG. 19a.This edge image is not related to the lens itself, and thus any dataassociated with that cup edge image are unnecessary and undesirable tothe processing of the data associated with the lens image itself; and amasking routine is invoked to eliminate the cup edge image from pixelarray 46, or more precisely, to produce a set of pixel illuminationvalues that is free of the pixel data associated with theabove-mentioned cup edge image 260.

FIG. 20 is a flow chart illustrating a preferred masking routine R₃. Thefirst step 262 in this routine is to determine whether, at steps 216 or226 of the decentration test, at least three pixels had been found onthe outside edge of annulus 162 or if the ophthalmic lens was found tobe badly decentered. If the lens had been found to be badly decenteredat either of these two steps of the decentration test, then maskingroutine R₃ itself terminates at step 262.

If routine R₃ does not terminate at step 262, the routine proceeds tostep 264, which is to obtain the coordinates of the center of the circlethat had been fitted to the outside edge 150a of annulus 150 during thedecentration test. These coordinates had been determined and then storedin memory, either in the memory of processor 64 or in memory disc 70,during the decentration test, and thus, these coordinates can beobtained by simply retrieving them from the memory. Once these centercoordinates are obtained, a mask subroutine is invoked at step 266. Withreference now to FIG. 19b, this subroutine, in effect, superimposes overpixel array 46, a circular mask 270 centered on the above-mentionedcenter coordinates, and having a diameter slightly larger than thediameter of the circle fitted to the outer edge of annulus 150. Themasking subroutine then assigns an I₉ value to each pixel based onwhether the pixel is inside or outside this mask. In particular, foreach pixel outside that mask, the masking subroutine assigns the pixelan I₉ value of zero; and for each pixel inside the mask, the maskingsubroutine assigns the pixel an I₉ value equal to the I₈ value for thepixel.

More precisely, at step 266, the coordinates (x₀, y₀) of theabove-mentioned center point and a radius value r₁, which is selected tobe slightly larger than the radius of the circle fitted to the outsideedge of annulus 150, are transmitted to the mask subroutine. Then thissubroutine forms a file f₂ of the addresses of all of the pixels inarray 46 that are within the distance r₁ of that center point (x₀, y₀).Then, at step 272, the address of each pixel in array 46 is checked todetermine if it is in that file. If the pixel address is in that file,then at step 274 the I₉ value of the pixel is set equal to the I₈ valueof the pixel; however, if the pixel address is not in that file, then atstep 276 the I₉ value of the pixel is set to zero.

Numerous specific mask subroutines are well-known in the art and may beemployed at step 266 of routine R₃.

FIG. 19c shows the pixels of array 46 illuminated at an intensity equalto their respective I₉ values.

After the masking procedure shown in FIG. 20 is completed, processor 64initiates a further procedure, referred to as the rubber band,algorithm. This algorithm, generally, involves analyzing and processingdata values for or relating to the pixels in and immediately adjacent tothe annulus edge 150a, and FIGS. 21a and 2lb show a flow chart thatgenerally illustrates the rubber band algorithm. With reference to theseFigures, the first step 280 in this algorithm is to obtain the centercoordinates and the radius of the circle fitted to the outer edge 150aof the lens in the decentration test. As discussed above, these valueshad been determined and then, stored in memory during the decentrationtest, and these values can be obtained by retrieving them from thatmemory.

The next step 282 in the rubber band algorithm is to locate a pixel onthe outer edge 150a of annulus 150 by searching inward from the leftedge of pixel array 46, until an illuminated pixel is found. It ispossible that the first illuminated pixel found during a given searchmight not be on the edge of the image of the lens, but might besomewhere else and illuminated because of background noise. Hence,preferably, a multitude of scans or searches are conducted at step 282to find a multitude of illuminated pixels, and the locations of thesepixels are then analyzed or compared to each other to help ensure that apixel is found on the edge of the lens image.

Once a first pixel is found on the edge of the lens image, the rubberband algorithm proceeds to step 284; and at this step this algorithm, ineffect, starts at this first pixel and traces all the way around theedge of the lens image, eventually returning to that first pixel. Duringthis first trace, the algorithm records in file f₃ the addresses of mostor all of the pixels on the outside edge of the lens image; and thealgorithm also identifies larger gaps in the lens edge, the lengths ofthose gaps, and larger extra pieces on the lens edge. At step 286, thealgorithm records in file f₄ the addresses of the pixels that are theend points of selected lines, discussed in greater detail below, that ineffect are drawn across any larger gaps in the lens edge and across andon either side of any larger extra pieces on that edge.

After this first pass or trace around the lens image is completed, therubber band algorithm then determines, at step 290, if any gap thatmight have been found is large enough to cause the lens to be rejected.If such a gap is found, the lens is rejected, and at step 292, theprinter 76 prints the message that the lens has a bad edge.

If the lens passes this gap test at step 290, the rubber band algorithmproceeds to make a second pass or trace around the edge of the lensimage. In this second pass , as indicated at 294 in FIG. 21b, thealgorithm identifies shallow features, such as smaller gaps and smallerextra pieces, extending either radially inward or outward along theoutside edge of the lens, and the algorithm tests each such detectedfeature to determine if the lens should be rejected because of it.Generally, this is done by computing, for each of at least selectedpixels on the outside edge of the lens, the dot product of two vectors,referred to as the radial vector and the edge vector, through thatpixel. The radial vector through a pixel is that vector that alsoextends through the center point of the circle fitted to the outsideedge 150a of annulus 150. The edge vector through a pixel is the vectorthat extends through that pixel and a second pixel on the outside edgeof annulus 150, a given number of pixels rearward, or counterclockwise,from the former pixel along the outside edge 150a of annulus 150.

For any pixel on a regular, circular portion of the lens edge that doesnot contain any defect--either a gap or an extra piece--the dot productof the two above-identified vectors will be substantially zero, becausethe radial and edge vectors through that pixel are substantiallyperpendicular. However, for most or all pixels on the edge of a gap oran extra piece on the lens edge, the dot product of the edge and radialvectors through that pixel will not be zero, because these two vectorsare not perpendicular. If any calculated dot product is greater than agiven value, then the lens is considered as not suitable for consumeruse and may be rejected.

If the lens passes the tests applied during the second pass around thelens edge, then the rubber band algorithm makes a third pass around theedge of the lens image, as represented by step 296 in FIG. 21B. Thisthird pass does not include any test to determine if the lens should berejected, but instead involves processing or preparing data forsubsequent tests. In particular, this third pass is made to produce aset of data values that is free of data associated with any defects inthe lens that are just inside the outer edge 150a of annulus 150. Thisset of data values is subsequently subtracted from a set of data valuescontaining data associated with those defects, to produce thereby a setof data values having only the data associated with those flaws.

Generally, in this third pass around the lens edge, the rubber bandalgorithm determines the average radial thickness of the outside edge150a of the annulus 150; and then the algorithm sets to zero the I₉values of all the pixels that are just inside that outside edge of theannulus. For example, if the outside edge of the annulus has an averagethickness of six pixels, then the rubber band algorithm may set to zerothe I₉ values of all of the pixels that are between 7 and 27 pixelsradially inward of the outside edge of the annulus.

FIGS. 22-32 illustrate the rubber band algorithm in more detail. Morespecifically, FIG. 22 illustrates one suitable subroutine S₁ forlocating a first pixel, P(x, y), on the outer edge 150a of the annulus150. At step 300, (x₀, y₀) is set equal to the coordinates of the centerof the circle that was fitted to the outer edge of the annulus duringthe decentration test; and at step 302, r₀ is set equal to the radius ofthat outer fitted circle . Then, as represented by step 304, a multitudeof horizontal scans are made across the pixel array 46, starting at, orabout at, the center of the left edge of the array. More precisely,processor 64 studies data values I₉ at addresses in the preprocessormemory that correspond to the addresses of pixels in selected horizontalline segments on the pixel array. During each of these scans, theprocessor 64 checks the I₉ value of each pixel in a given horizontal rowof pixels, and identifies the first pixel in that row that has an I₉value above a given, value; and preferably, a multitude of such scansare made, resulting in a multitude of identified pixels.

Typically, all of these identified pixels will be on the outer edge 150aof the annulus 150. It is possible, though, that a pixel somewhere onthe array and to the left of that edge might have a high I₉ value due tobackground noise or stray light incident on the pixel during the lensinspection procedure, and such a pixel might be identified as anilluminated pixel in the above-mentioned scans. To prevent such a pixelfrom being identified as an edge pixel, subroutine, S₁, at step 306,identifies and discards the addresses of any such pixels. Morespecifically, the subroutine, first, determines the distance betweeneach of the pixels identified in the scans and the center (x₀, y₀) ofthe outer circle fitted to the outside edge, of the lens image duringthe decentration test; and second, compares each determined distance tor₀, which had been set equal to the radius of that fitted outer circle.If the distance between a particular pixel and the center of that fittedcircle exceeds r₀ by more than a given distance, d₃, then that pixel isconsidered as not being on or immediately adjacent the edge of annulus150, and the address of that pixel is discarded. After the addresses ofall the pixels found during the scan are checked to determine if theyare on or immediately adjacent the lens edge--and the ones that are, notare discarded--then, as shown at step 310, any remaining pixel addressmay be selected as pixel P(x, y), and then the first pass around theedge of the lens image is begun.

FIG. 23 illustrates in greater detail how this first pass is made, andin particular, shows Routine R₄ for making this pass. Starting at pixelP(x, y), at step 312, the algorithm searches forward, or clockwise,along the outer edge of the annulus, 150 for either a large gap in thatedge, or a large extra piece on that edge, as represented by steps 314and 320. Any suitable subroutine or procedure may be used to searchalong the edge. For instance, from each given pixel on that edge,starting with pixel P(x,y), the processor may check the three or thefive closest pixels in the row above or below the given pixel or in thecolumn to the right or to the left of the given pixel, depending on thequadrant or sector of display 46 in which the given pixel is located, toidentify the next pixel on the lens edge. From this next pixel, theprocessor may use this same procedure to identify the still next pixelon the lens edge.

Also, for each pixel that is found on the lens edge, the processor maydetermine the distance, r, between that pixel and the center point (x₀,y₀) of the circle fitted to the outside edge of the lens. The processormay conclude that a large gap has been found when, for each of a givennumber of consecutive pixels on the lens edge, r is smaller than r₀ bymore than a given amount d_(g) (that is, r₀ -r>d_(g)). Conversely, theprocessor may conclude that a large extra piece has been found when, foreach of a given number of consecutive pixels on the lens edge, r isgreater than r₀ by more than a given amount d_(ep) (that is, r-r₀>d_(ep)).

If a gap or an extra piece is found, subroutines S₂ or S₃, both of whichare discussed in greater detail below, are invoked respectively at steps316 and 322. If neither a gap nor an extra piece is found, then routineR₄ moves on to step 324.

At step 324, routine R₄ tests to determine if the first pass around theedge of annulus 150 is complete, and any suitable specific procedure orsubroutine may be used to do this. For instance, as mentioned above, asthe trace is made around the image of the lens edge, a file f₃ is madeof the addresses of the pixels that have been found on that edge. Atstep 324, that file may be checked to determine if the address of thecurrent edge pixel being considered is already on the file. If the pixeladdress is already on the file, then the first pass around the image ofthe lens edge is considered to be complete, while the pass is consideredas not complete if this current pixel address is not already on file f₃.If the first pass is complete, then the rubber band algorithm moves ontoroutine R₅ ; but if the first pass around the lens is not complete, thealgorithm moves on to step 326 and the address of this current edgepixel being considered is added to file f₃. Then at step 330, the nextpixel on the lens edge is found and P(x, y) is set equal to the addressof this next pixel, and the routine R₄ then returns to step 312.

FIG. 24 is a flow chart outlining subroutine S₂, which is invoked eachtime a gap is found on the outside edge of annulus 150. The first step332 in this subroutine is to identify and record in a file f₄ theaddress of the pixels at the beginning and the end of the gap and thedistance between these two end pixels. These two pixels are shown at P₁and P₂ respectively in FIG. 25A. Once a gap is found--that is, for eachof a given number of consecutive pixels on the lens edge, r is smallerthan r₀ by more than d_(g) --the last pixel on the lens edge before thatgiven number of consecutive pixels may be considered as the pixel at thebeginning of the gap.

Also, once a gap has been found, the end of the gap may be found bysearching across the gap, along the pixels on the circle fitted to theoutside edge of the lens in the decentration test, and searchingradially inwardly and outwardly for a given number of pixels from thatportion of the fitted circle, until the lens edge is found--that is,until illuminated pixels, or more precisely, pixels having high I₉values are found. After the lens edge is found, the gap may beconsidered as having come to an end. Once a series of consecutive pixelsis found that are all within a certain distance of that fitted circle;and in particular, when for each pixel in that series, r₀ -r is lessthan d_(g). The last pixel on the lens edge before that series ofconsecutive pixels may be considered as the pixel at the end of the gap.

At step 340 of subroutine S₂, the I₉ values of the pixels on the linebetween pixels P₁ and P₂ --the line segment L₁ in FIG. 25b--are setequal to the maximum illumination intensity value, and then thesubroutine returns to routine R₄.

FIG. 26 shows a flow chart illustrating subroutine S₃, which is invokedat step 322 of routine R₄ when an extra piece 350 is found on the edgeof annulus 150. The first few steps in routine S₃ are done, in effect,to draw various bridge lines relating to the extra piece. In particular,at step 352, the subroutine identifies pixels P₃ and P₄, shown in FIG.25b, on the edge of the annulus 150 at the start and at the end of theextra piece 350; and then, at step 354, the I₉ value of each pixel on aline segment L₂, shown in FIG. 25c, between pixels P₃ and P₄, is set toT_(max). Next, at step 356, the subroutine identifies the address of apixel P₅ that is on the edge of the annulus 150 a given number of pixelsrearward, or counterclockwise, of the start of the extra piece 350; andat step 360, the pixel P₆ on the edge of the extra piece that is a givendistance d₄ from pixel P₅ is found. Next, at step 362, and also withreference to FIG. 25d, the I₉ value of each pixel on a line L₃ betweenpixels P₅ and P₆ is set to T_(max).

Next, at step 364, the subroutine identifies the address of anotherpixel P₇ that is on the edge of the annulus 150 a given number of pixelsforward, or clockwise, of the end of the extra piece; and then, at step366, the subroutine identifies the pixel P₈ on the edge of the extrapiece that is a given distance d₅ from pixel P₈. At step 370, the I₉value of each pixel on the line L₄, shown in FIG. 25e, between pixels P₇and P₈ is also set to T_(max). After the appropriate bridge lines aredrawn, the subroutine returns to routine R₄.

After the first pass around the image of the lens edge is completed,subroutine R₅ is invoked. This routine, which is illustrated in FIG. 27,is used to determine if any of the gaps, which may have been foundduring the first pass around the image of the lens edge, is wide enoughto make the lens unsuitable for consumer wear. The first step 376 inroutine R₅ is to determine if any gaps were in fact found during thefirst pass around the lens edge. If no gaps were found, routine R₅itself is terminated and the rubber band algorithm proceeds to routineR₆. However, if any gaps were found during the first pass around thelens edge, routine R₅ proceeds to step 380. At this step, each gap widthis compared, one at a time, to a given value d₆ ; and if any gap widthis greater than that value d₅, then the lens is considered to beunsuitable for consumer use, and the lens is rejected at step 382. Ifall of the gap widths are less than d₅, however, then routine R₅terminates, and the rubber band algorithm proceeds to routine R₆, whichperforms the second pass or trace around the image of the lens edge.

Routine R₆ is illustrated in FIG. 28. As previously mentioned, thisroutine primarily searches for shallow gaps in the lens edge and smallextra pieces on the lens edge that were not identified as gaps or extrapieces in routine R₄, which was the first pass around the lens edge. Inparticular, at step 384, the address of pixel P(x, y) is set equal tothe address of the first pixel in file f₃. Then, at steps 386, 390, and392, two vectors V₁ and V₂, referred to as edge and radial vectorsrespectively, are identified and the dot product of these two vectors iscalculated. More specifically, the first vector V₁ is the vector throughpixel P(x, y) and a second pixel on the lens edge, a given number ofpixels rearward or counterclockwise of pixel P(x, y) along that lensedge, and the second vector V₂ is the radial vector of the annulus 150that extends through pixel P(x, y). The slopes of these two vectors andtheir dot product can be easily determined from the addresses of thepixels through which the vectors extend.

With reference to FIG. 29, if pixel P(x, y) is along a regular, circularportion of the lens edge, then the edge vector V₁ through the pixel issubstantially tangent to the lens edge, as shown at 394 in FIG. 29.Also, this vector V₁ is substantially perpendicular to the radial vectorV₂ through that pixel, and the dot product of these two vectors V₁ andV₂ is substantially zero. However, if pixel P(x, y) is on an irregularportion of the lens edge, such as on the edge of a gap or of an extrapiece on the lens, as shown at 396 and 400 in FIG. 29, then the edgevector V₁ and the radial vector V₂ through pixel P(x, y) are notnormally perpendicular, and the dot product of these two vectors willnormally not be zero.

The dot product of these two vectors V₁ and V₂ is compared, at step 402,to a given value d₇. If that dot product is equal to or greater thanthat given value--which indicates that an appreciable gap or extra pieceis present in the area of pixel P(x, y)--then the lens is consideredunacceptable for consumer use and is rejected at step 404, and theentire routine R₆ terminates. If at step 402, the calculated dot productis less than d₇ --which indicates that in the area of pixel P(x, y), anydeparture of the lens edge from a perfect circle is within an acceptablelimit--then routine R₆ moves on to step 406. At this step, the routinetests to determine if this second pass or trace around the image of thelens edge is complete. This is done, more specifically, by testing todetermine if pixel P(x, y) is the last pixel on file f₃. If it is, thenthe second pass is complete, and the rubber band algorithm proceeds toroutine R₇. If, though, at step 406, it is determined that this secondpass around the lens edge image is not complete, then at step 408, theaddress of pixel P(x, y) is set equal to the address of the next pixelon file f₃, and then the routine returns to step 386. Steps 386 through408 are repeated until either the lens is rejected or, for each pixel onfile f₃, the associated dot product of the two vectors V₁ and V₂ throughthat pixel has been calculated and found to be less than d₇, at whichtime the rubber band algorithm proceeds to routine R₇, which performsthe third pass or trace around the lens edge.

Preferably, the above-mentioned dot product is not calculated for allthe pixels on the lens edge, and in particular, that product is notcalculated for the pixels that are on the edges of gaps or extra piecesthat were found during the first trace around the lens edge. It is notnecessary to calculate this dot product for these gap and extra piecepixels since it is already known that the pixels are on either a gap oran extra piece, and an appreciable amount of processing time may besaved by not determining the V₁ and V₂ vectors through those pixels andthe dot product of those two vectors.

After routine R₆ is completed, the rubber band algorithm proceeds toroutine R₇, which performs the third pass or trace around the lens edge.As previously discussed, the purpose of this third pass is, in effect,to produce a new set of data values I₁₀ that are free of any dataassociated with any flaws in the lens that are just inside the outsideedge of the lens. FIG. 30 shows routine R₇ in greater detail; and thisroutine, generally, is comprised of three parts. In the first part, theI₁₀ value for each pixel is set equal to the I₉ value for the pixel; inthe second part, an average edge thickness value, N, is calculated forthe outside edge 164 of annulus 162; and in the third part, the I₁₀values of the pixels in a given range further inside of that averageedge thickness are set to zero.

More specifically, at step 410 of routine R₇, the I₁₀ value for eachpixel is set equal to the I₉ value for the pixel. Next, with referenceto FIGS. 30 and 31, at step 412, a given number of pixels, shown at414a-e in FIG. 31, on the extreme outside edge 150a of annulus 150 areselected. Then, at step 416, routine R₇ counts the number of illuminatedpixels on each of the radii, shown at 420a-e in FIG. 31, of the lensimage that passes through the pixels 414a-e. For instance, the routinemay count the pixel on the extreme outside edge of the annulus as thefirst pixel, and then search radially inward from that pixel, andincrease that count value by one for each illuminated pixel on thatradius. At step 422, the average number of illuminated pixels per radiusis calculated; and this may be done, for example, simply by dividing thetotal number of counted illuminated pixels by the number of radial scansmade. Typically, this average value is not a whole number, and thuspreferably that average value is then increased to the next largestwhole number.

In the next part of routine R₇, a third pass is made around the outsideedge 150a of annulus 150. To start this pass, any pixel on that edge isselected as the starting pixel P(x, y), as indicated at step 424 in FIG.30. Then, as represented by steps 426 and 430, the I₁₀ values forselected pixels radially inward of the average edge thickness, are setto zero. More specifically, at each pixel on the outside edge of annulus162, the routine counts N number of pixels radially inward along theradius of the lens. Then, for each of a given number of pixels furtherradially inward along that radius, the I₁₀ value of the pixel is set tozero. With reference to FIG. 32, these steps of the routine, in effect,set to zero the I₁₀ values of the pixels in the cross hatched area 432.

At step 434 of Routine R₇, a check is made to determine if this thirdpass around the image of the lens edge is complete, and any suitablesubroutine may be invoked to do this. For instance, if the pixelselected as the starting pixel for this pass is the top pixel in filef₃, then the pass may be considered as complete after the routine hasperformed steps 426 and 430 for the bottom pixel on that file.Alternatively, a separate list of the addresses of the pixels used insteps 426 and 430, of routine R₇ may be made; and each time a pixeladdress is added to that list, the list can be checked to see if the newaddress being added is already on the list. If an address value that isadded to list is already on that list, then the third pass around theimage of the lens edge is considered to be complete.

If, at step 434, this third pass around the lens image is not complete,then at step 436, the address of pixel P(x, y) is set equal to theaddress of the pixel that is, clockwise, next to the current pixel P(x,y) along the outside edge 150a of annulus 150. For example, this addressmay be taken from file f₃ ; and at step 436, the address of pixel P(x,y) may simply be set equal to the address on that file that is next tothe current pixel address. Then, the routine R₇ returns to step 426, andsteps 426, 430, and 434 are repeated for the new pixel address P(x, y).

After this third pass around the image of the lens edge is completed,processor 64 exits routine R₇ and the rubber band algorithm terminates.

After the rubber band algorithm is finished, a number of furtheroperations are performed, the general objective of which is to emphasizeany irregularities in the lens under consideration or inspection,thereby to make it easier to identify those irregularities subsequently.

The first of these procedures, referred to as a fill-in procedure, is toestablish a further set of data values I₁₁ for the pixels in array 46,and which may be used to identify pixels in any irregularities in, on,or adjacent the outside edge of annulus 150. More specifically, withreference to FIG. 33, these data values are used to identify pixels in(i) any gaps in the lens edge, such as shown at 436, (ii) anyirregularities inside the lens edge, such as shown at 440, (iii) anyextra pieces on the lens edge, such as shown at 442 and (iv) the pixelsbetween any extra pieces and the adjacent line segments L₃ and L₄ formedat steps 362 and 370 in subroutine S₃.

This fill-in procedure comprises a number of more specific operationsreferred to as MAX, PMAX, MIN, and PMIN, which involve processing a setof base data values associated with the pixels. In a MAX operation, anew data value is established for a given pixel that is equal to themaximum base data value of that pixel's eight immediately adjacentneighbors; and in a PMAX operation, a new data value is established fora given pixel that is equal to the maximum base data value of the fourpixels that are immediately to the left, to the right, above, and belowthe given pixel. In a MIN operation, a new data value is established fora given pixel that is equal to the minimum base data value of thatpixel's eight immediate neighbors; and in a PMIN operation, a new datavalue is established for a given pixel that is equal to the minimum basedata value of the four pixels that are immediately to the left, to theright, above, and below the given pixel.

FIGS. 34a through 34e illustrate the MAX, PMAX, MIN, and PMINoperations. More specifically, FIG. 34a shows a 7×7 array of numbers;and each number represents a data value for an associated pixel, withthe position of the number in the array corresponding to the address ofthe associated pixel. Hence, for instance, the data value for the pixelat address (1,1) is 7; the data value for the pixel at address (4,1) is0; and the data values for the pixels at addresses (4,2), (4,7), and(5,2) are 7, 0, and 0, respectively.

FIG. 34b shows the values produced after a MAX operation has beenperformed on the whole array of numbers shown in FIG. 34a. Thus, forexample, in FIG. 34b, the data value at address (2,6) is 7 because, inFIG. 34a, one of the eight pixels adjacent that pixel address has avalue of 7. Similarly, the value at address (6,2) in FIG. 34b is 7because, in the data set of FIG. 34a, one of the eight pixels adjacentthat pixel address has a value of 7. FIG. 34c shows the values producedas a result of a PMAX operation on the whole data set of FIG. 34a; andfor instance, the values at addresses (6,3) and (6,4) in FIG. 34c are 7because, in FIG. 34a, each of these two pixel addresses is immediatelyto the right of a pixel having a value of 7.

FIGS. 34d and 34e show the values produced after MIN and PMINoperations, respectively, have been performed on the array of valuesshown in FIG. 34a. For example, in FIG. 34d, the value at address (4,3)is zero because, in FIG. 34a, one of the eight pixels neighboringaddress (4,3) has a zero value; and in FIG. 34e, the value at address(4,2) is zero because, in FIG. 34a, the pixel immediately to the rightof that pixel address has a value of zero.

FIG. 35 illustrates a preferred fill-in procedure R₈. With referencethereto, the procedure involves 14 separate operations performed on datavalues for the pixel array 46; and each of these operations isperformed, one at a time, over the entire pixel array. These operationsare, in order: MAX, PMAX, PMAX, MAX, MAX, PMAX, PMAX, MIN, PMIN, PMIN,MIN, MIN, PMIN, and PMIN. These operations start with the I₉ values forthe pixels, and the resulting data values, after all 14 operations arecompleted, are referred to as the I₁₁ values.

The results of these operations are, in effect, to fill in the gaps 436,the extra pieces 442, and the irregularities 440 in, on, or adjacent theoutside edge of annulus 150. More specifically, FIGS. 33 and 36 show thesame portion of the annulus 150, with the former figure showing thepixels illuminated at their I₉ values, and the latter figure showing thepixels illuminated at their I₁₁ values. The differences between thesetwo figures show the effect of the fill-in procedure of FIG. 35. Inparticular, this difference is that for the pixels in the gaps 436, inthe extra pieces 442, in irregularities 440, and in the areas betweenthe extra pieces and the line segments L₃ and L₄, the I₁₁ values forthese pixels are T_(max) while the I₉ values for these pixels are zero.

As will be understood by those of ordinary skill in the art, otherspecific procedures are known and may be used to produce the desired I₁₁values for the above-described pixels.

After the fill-in operation R₈ is completed, processor 64 invokes asecond masking procedure R₉ to produce a set of pixel illuminationvalues I₁₂ that is free of the effect of any light incident on pixelarray 46 within a given radius of the center point of the circle fittedto the inside edge 150b of annulus 150 during the decentration test. Asdiscussed in greater detail below, this set of pixel illumination valuesI₁₂ is subsequently used to help identify defects in the interior of thelens--that is, in the area radially inside the inside edge of annulus150.

The masking procedure R₉ employed at this stage of the lens inspectionprocess is very similar to the masking routine R₃ shown in FIGS. 19a-19cand 20. The principle difference between these two masking procedures isthat the radius of the mask used in procedure R₉ is slightly smallerthan the radius of the circle fitted to the inside edge of annulus 150,while the radius of the mask used in procedure R₃ is slightly largerthan the radius of the circle fitted to the outside edge of annulus 150.

FIG. 37 is a flow chart illustrating a preferred masking routine R₉. Thefirst step 446 in this routine is to determine whether at steps 216 or226 of the decentration test, at least three pixels had been found onthe inside edge of annulus 150, or if the ophthalmic lens was found tobe badly decentered. If the lens had been found to be badly decenteredat either of these-two steps of the decentration test, then maskingroutine R₉ itself terminates at step 450.

If routine R₉ does not terminate at step 450, the routine proceeds tostep 452, which is to obtain the coordinate of the center of the circlethat had been fitted to the inside edge 150b of annulus 150 during thedecentration test. These coordinates had been determined and then storedin processor memory during the decentration test, and these coordinatescan be obtained by simply retrieving them from the processor memory.Once these center coordinates are obtained, a mask subroutine is invokedat step 454. With reference now to FIGS. 38a-38c, this subroutine ineffect, superimposes over pixel array 46, a circular mask 456 centeredon the above-mentioned center coordinates and having a diameter slightlysmaller than the diameter of the circle fitted to the inside edge 150bof annulus 150, and then the masking subroutine assigns an I₁₂ value toeach pixel. In particular, for each pixel outside that mask, the maskingsubroutine assigns the pixel an I₁₂ value equal to the I₈ value for thepixel; and for each pixel inside the mask, the masking subroutineassigns the pixel an I₁₂ value of zero.

More precisely, at step 452, the coordinate (x_(i), y_(i)) of theabove-mentioned center point and a radius value r₂, which is selected tobe slightly smaller than the radius of the circle fitted to the insideedge of annulus 150, are transmitted to the mask subroutine. Then, atstep 454, this subroutine forms a file f₅ of the addresses of all of thepixels in array 46 that are within the distance r₂ of that center point(x_(i),y_(i)). Then, at step 460, the address of each pixel in array 46is checked to determine if it is in that file. If the pixel address isin that file, then at step 462, the I₁₂ value of the pixel is set tozero; however, if the pixel address is not on the list, then at step464, the I₁₂ value of the pixel is set equal to the I₈ value of thepixel.

Numerous specific mask subroutines are well-known in the art foraccomplishing the above objective and any suitable subroutine may beemployed at step 454 of routine R₉.

FIG. 38c shows the pixels of array 46 illuminated at intensities equalto their respective I₁₂ values.

After this second masking procedure is completed, a further routine R₁₀,consisting of a series of operations, is performed to provide a set ofpixel illumination values that clearly identify the pixels that are inany irregularity or defect in the lens being inspected. Morespecifically, the purpose of these further operations is to provide aset of pixel illumination values that is free of any effect produced onarray 46 by background noise or light as well as any effect produced onarray 46 by the normal or regular edges 150a and 150b of annulus 150.These further operations are shown in the flow chart of FIG. 39.

At step 466, a further I value, I₁₃, is obtained for each pixel; and inparticular, the I₁₃ value for each pixel is obtained by subtracting theI₁₂ value for the pixel from the I₁₀ value for the pixel. FIGS. 40a,40b, and 40c show the pixels in a portion of annulus 162 illuminated atintensities equal to their I₁₀, I₁₂, and I₁₃ values, respectively; andas can be seen, the practical effect of step 466 is to subtract theimage of FIG. 40b from the image of FIG. 40a to produce the image ofFIG. 40c.

Then, at step 470, an operation, referred to as a clean-up operation, isperformed to, in effect, help eliminate spurious illuminated pixels.More particularly, starting with the I₁₃ values for the pixels, MAX,MIN, PMIN, and PMAX operations are performed, in that order, on theentire pixel array 46, producing a further set of pixel values referredto as I₁₄ values. FIG. 40d shows the pixels of annulus 46 illuminated atintensities equal to their respective I₁₄ values; and as can be seen bycomparing FIGS. 40c and 40d, the effect of the clean-up operation issimply to eliminate various isolated pixels that, for one reason oranother, are illuminated in FIG. 40c.

After system 10 has processed the data according to the routines R₁ -R₁₀described above, a flaw or defect analysis is made, and FIGS. 41a and41b show a flow chart illustrating a preferred defect detection oranalysis routine R₁₁. This analysis may be best understood withreference to FIG. 42, which shows the pixels of a portion of annulus 150illuminated at intensities equal to their respective I₁₄ values.

With reference to FIGS. 41a, 41b, and 42, in the first part of thisdefect analysis, at steps 472 and 474 of FIG. 41a, a list is made of theaddresses of the pixels at the start and at the end of each horizontalseries of consecutive illuminated pixels, referred to as a run length.More specifically, processor 64, in effect, scans across each horizontalrow of pixels in array 46; and during each scan, each time a series ofilluminated pixels is encountered, the addresses of the first and lastpixels in that series are recorded in file f₆. In the case of a singleisolated illuminated pixel--that is, the pixels on the left and right ofthis illuminated pixels are themselves not illuminated--the address ofthis illuminated pixels is recorded as both the address of the first andthe address of the last pixel in the run length formed by theilluminated pixel.

More precisely, the processor does not in fact scan across an image ofthe pixel array, but instead compiles the above-mentioned address listby checking the I₁₄ values stored in the processor memory for the pixelsin array 46.

After file f₆ is completed, routine R₁₁ invokes a clustering subroutineat step 476 to create a separate file f_(6a) . . . f_(6n) for each areaor group of contiguous illuminated pixels--or, more precisely, for eacharea or group of contiguous pixels having high I₁₄ values. Any suitableclustering subroutine may be employed to do this clustering. After theseseparate files f_(6a) . . . f_(6n) are created, then at step 480 thefiles for illuminated areas that are near to each other, such as thoseshown at 482 and 484 of FIG. 42, are merged. This may be done, forinstance, by checking to determine if any pixel in one illuminated areais within a given number of pixels, such as two or three pixels, of anypixel in another illuminated area. These close illuminated areas areconsidered as forming, in fact, one illuminated area.

After step 480 is completed, subroutines are invoked at step 486 tocompute the area and centroid of, and a bounding box for, each area ofilluminated pixels. Numerous subroutines are well-known in the art forperforming these computations. Any such suitable subroutines may beemployed in routine R₁₁, and it is not necessary to describe thesesubroutines in detail herein.

Next, routine R₁₁ determines the general location of each illuminatedarea. More specifically, at step 490, the address of the centers and theradii of the two circles fitted to the outer and inner edges 150a and150b of annulus 150 are obtained. These data were determined or foundduring the decentration test and were then stored in the processormemory, and these data can be obtained by simply retrieving the datafrom that processor memory. Then, at step 492, processor 64 determineswhether the centroid of each area of illuminated pixels is located (i)inside the central zone of the lens (the area radially inside the circlefitted to the inner edge of the annulus), or (ii) the peripheral zone ofthe lens (the area of the lens between the two circles fitted to theinner and outer edges of the annulus).

Numerous subroutines are well known for determining whether a centroidof an area is within a first circle or between two generally concentriccircles, and it is not necessary to describe these subroutines in detailherein.

Steps 490 and 492 are not necessary to the operation of system 10 in itsbroadest sense. Preferably, though, these steps are done and theassociated data are collected for analysis purposes, and in particular,to help identify where possible irregularities or defects are occurringin the lenses. These data may be helpful in adjusting or refining theprocedure or materials used to make the lenses.

After steps 490 and 492 are completed, the processor then determineswhether the size of each illuminated area of pixels is sufficientlylarge to qualify as a flaw or defect for which the lens may be rejected.More specifically, at step 494, the size of each area of illuminatedpixels is compared to a preselected size. If that illuminated area issmaller than that preselected size, then the illuminated area is notsufficient to reject the lens. However, if that area of illuminatedpixels is larger than the preselected size, then that illuminated areaqualifies as a flaw or defect that makes the lens unsuitable forconsumer use. This preselected size may be stored, for example, inmemory unit 70.

Also, preferably at step 496 a count is maintained of the number ofdefects found in each lens. This count may also be useful for analyzingthe process and materials used to make the lenses.

At step 500, a display is produced on monitor 72 showing the areas ofilluminated pixels, with those areas that are larger than theabove-mentioned threshold size being shown within a bounding box. Then,at step 502, processor 64 checks to determine if any defects were infact found in the lens. If a defect had been found, then at step 504 areject lens signal is generated and transmitted to monitor 72 andprinter 76, and the lens may be removed from system 10. If, however, nodefect had been found in the lens, then routine R₁₁ simply terminates.Subsequently, system 10 operates to move another lens past illuminatedsubsystem 14 and another pulse of light is transmitted through thatother lens. This transmitted light is focused on pixel array 46 and theabove-described processing procedure is repeated to determine if thisother lens is acceptable for consumer use.

While it is apparent that the invention herein disclosed is wellcalculated to fulfill the objects previously stated, it will beappreciated that numerous modifications and embodiments may be devisedby those skilled in the art, and it is intended that the appended claimscover all such modifications and embodiments as fall within the truespirit and scope of the present invention.

What is claimed is:
 1. An apparatus containing an ophthalmic lens, saidlens having a radius of curvature, said apparatus comprising:a basemember; a well connected to the base member to hold the ophthalmic lens,the well being substantially transparent, and including:i) afrusto-conical sidewall having a downward slope to a bottom portion, andii) said bottom portion hemi-spherically shaped and connected to andextending downward from the sidewall, and having a radius of curvaturelarger than said ophthalmic lens radius of curvature contained therein,said larger bottom portion radius or curvature allowing only singlepoint contact between said bottom portion and said ophthalmic lens. 2.Apparatus according to claim 1, wherein:the well defines an axis, andthe sidewall of the well extends at an angle of about 20° to the axis;and the thickness of the sidewall of each well is less than about 0.010inches.
 3. Apparatus according to claim 2 wherein the ophthalmic lenshas a diameter and the bottom portion of the well has a diameter largerthan the diameter of said ophthalmic lens.
 4. Apparatus according toclaim 3, wherein the well has a depth greater than the diameter of saidophthalmic lens.
 5. Apparatus according to claim 4, wherein saidophthalmic lens diameter is approximately 20 mm.
 6. Apparatus accordingto claim 5, wherein the well includes a top circular portion having adiameter of approximately 22 mm.
 7. Apparatus according to claim 6,wherein the well has a depth of approximately 20 mm.
 8. Apparatusaccording to claim 1, wherein the radius of curvature of the well isapproximately 11 mm.
 9. The apparatus according to claim 1, wherein thewell is made from a PVC plastic material.
 10. An ophthalmic lens carriercontaining a multitude of ophthalmic lenses, comprising:a base member; amultitude of wells connected to the base member, each of the wells beingsubstantially transparent and including:i) a frusto-conical sidewallhaving a downward slope to a bottom portion, ii) said bottom portionhemi-spherically shaped, having a radius of curvature, and connected toand extending downward from the sidewall; and said multitude ofophthalmic lenses, having a respective one of said lenses being disposedin each of the wells; wherein the lenses have a uniform radius ofcurvature, less than the curvature of said bottom portion of the wellsallowing between each bottom portion of said wells and each of saidlenses contained therein, a single point of contact.
 11. The lenscarrier according to claim 10, wherein each lens seats on the bottomportion of the well in which the lens is disposed.
 12. The lens carrieraccording to claim 11, wherein each well contains a fluid solution, andthe lens in each well is fully submerged in the fluid solution therein.13. The lens carrier according to claim 11, wherein:each well defines anaxis, and the sidewall of the well extends at an angle of about 20° tosaid axis; and the thickness of the sidewall of each lens is less thanabout 0.010 inches.
 14. The lens carrier according to claim 13,wherein:the ophthalmic lenses have a uniform diameter; and the bottomportion of each well has a diameter larger than the diameter of the lenscontained therein.
 15. The lens carrier according to claim 14, whereineach well has a depth greater than the ophthalmic lens diameter.
 16. Anapparatus containing ophthalmic lenses, each lens having a radius ofcurvature, said apparatus comprising:a base member; a multitude of wellsconnected to the base member, each of the wells being substantiallytransparent and adapted to hold a respective one of the lenses, each ofthe wells includingi) a frusto-conical sidewall having a downward slopeto a bottom portion, and ii) said bottom portion hemi-spherically shapedand connected to and extending downwardly from the sidewall, and havinga constant radius of curvature larger than said lens radius of curvatureallowing only single point contact between said bottom portion and saidophthalmic lens.
 17. Apparatus according to claim 16, wherein:each welldefines an axis, and the sidewall of the well extends at an angle ofabout 20° to the axis; and the thickness of the sidewall of each well isless than about 0.010 inches.
 18. Apparatus according to claim 17, foruse with ophthalmic lenses having a lens diameter, and wherein:thebottom portion of each well has a diameter larger than the lensdiameter; and each well has a depth greater than said lens diameter. 19.Apparatus according to claim 18, wherein:said multitude of well s arearranged in a rectangular array of wells; and the axes of the wells arespaced apart from each other by approximately 30 mm.
 20. Apparatusaccording to claim 19, wherein:each well includes a top circular portionhaving a diameter of approximately 22 mm; the depth of each well isapproximately 22 mm; and the radius of curvature of each well isapproximately 11 mm.